package com.ganmiao.server.supplier.mapper;

import com.ganmiao.server.supplier.entity.TenderProduct;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface TenderProductMapper {

    @Select("<script>" +
            "select * from tenders_products " +
            "<if test='id != null' >" +
            "where id = #{id}" +
            "</if>" +
            "</script>")
    public TenderProduct tendersProductsGet(Integer id);

    @Insert("insert into tenders_products(id,tenders_id,product_id, status)" +
            "values(#{id},#{customer_id},#{product_id}, #{status})")
    public Integer tendersProductsInsert(TenderProduct tenders);

    @Delete("DELETE FROM tenders_products WHERE id = #{id}")
    public void tendersProductsDelete(Integer id);

    @Update("UPDATE tenders_products SET tenders_id = #{tenders_id}, product_id = #{product_id}, status = #{status} WHERE id = #{id}")
    public void tendersProductsUpdate(Integer id, Integer tenders_id, Integer product_id, Integer status);
}
